Embodiments of the inventive subject matter generally relate to the field of data processing, and, more particularly, to protocol data unit assembly.
Communications between computers over a network are facilitated by components that include a combination of software, firmware, and/or hardware, commonly referred to as a “network stack” or “protocol stack”. The components of the network stack are “layered” and designed to facilitate the communications according to the function of each particular layer. For example, the components at the network layer determine how to send data from one computer to another over the network. The components at the application layer, however, may only represent data and commands that are specific to an actual software application, such as a web browser or e-mail application. Thus, the network layer may add (when sending) or remove (when receiving) data specific to communicating the data from one computer to another. The components at the application layer, however, may have no knowledge of the data used by the network layer. Each layer operates on a unit of data that conforms to a protocol implemented at the given layer. Although the protocol at each layer may refer to the data unit by a particular moniker (e.g., packet, frame, message, etc.), this unit of data is generally referred to as a protocol data unit (PDU).
For example, consider a network stack that consists of an application layer, a network layer, and a physical layer. Two computers are connected via a network and both implement compatible network stacks. A file transfer application on an originating computer of the two computers can create an “application message”. The application message is designed to be received by a compatible file transfer application on the other computer (the receiving computer). The application message might indicate that the file transfer application on the originating computer is attempting to transfer a file to the file transfer application on the receiving computer. The application message might also include the data associated with the file being transferred. The application message can consist of a header, which typically contains data about the message (such as a command), and a payload, which contains the actual data associated with the message (such as the file data).
Once the application message is created, the file transfer application passes the application message to the network layer. Components at the network layer communicate using packets. The format of a packet may be different than that of an application message, and thus the networking layer components might convert the application message into one or more packets. For example, packets may be a fixed size that is smaller than the application message. Thus, the networking layer components might break the application message into multiple packets. Similarly, the packets may be a fixed size greater than the size of the application message. Thus, the networking layer components might put multiple application messages into a single message. Further, the networking layer components might add additional data to the packet, such as network addresses associated with the two computers. Similar to an application message, a packet comprises a header and a payload. The header contains data about the packet, while the payload can contain the application message (including the application message header) or a subset thereof.
The originating computer's network layer components pass the packet(s) to the physical layer of the originating computer. The physical layer components format packets from the network layer into frames in accordance with the physical layer protocol and transmit the frames with the physical characteristics as defined by the physical layer protocol. The physical layer components of a computer can include a network interface card and a network interface card driver. The network interface card transmits the frames as signals to a network interface card on the receiving computer. The receiving computer's physical layer components process received signals into frames, extract payloads from the frame, and supply the payloads to the receiving computer's network layer components. The receiving computer's network layer components process the payloads from the physical layer as network layer packets, decapsulate payloads from the network layer packets, and provide the payloads to the application layer at the receiving computer. The receiving computer's application layer components then reassemble the application message from the payloads provided from the network layer.